Data writing method and data storage device for adjusting programming voltage values

ABSTRACT

A data storage device and method including a controller configured to adjust a plurality of programming voltage values for programming most significant bits (MSB) of a plurality of stored data patterns of the memory cells of the flash memory to obtain a plurality of adjusted programming voltage values, wherein the controller is configured to determine a plurality of neighboring data pairs having the stored data patterns corresponding to the programming voltage values neighboring to each other, determine a plurality of difference bits between the stored data patterns of the neighboring data pairs, determine a plurality of target neighboring data pairs with the difference bits corresponding to the most significant bits from the neighboring data pairs, and adjust the programming voltage values to increase the gaps between the adjusted programming voltage values corresponding to the stored data patterns of the target neighboring data pairs.

CROSS REFERENCE TO RELATED APPLICATIONS

This Application is a Continuation of co-pending U.S. application Ser.No. 13/191,745, filed on Jul. 27, 2011, which claims priority of TaiwanPatent Application No. 099125871, filed on Aug. 4, 2010, the entiretiesof which are incorporated by reference herein.

BACKGROUND OF THE INVENTION

1. Field of the Invention

The invention relates to flash memories, and more particularly to datawriting of flash memories.

1. Description of the Related Art

Flash memories are divided into single level cell (SLC) flash memories,multi level cell (MLC) flash memories, and triple level cell (TLC) flashmemories. A memory cell of an SLC flash memory stores a single data bit.A single memory cell of an SLC flash memory is therefore capable ofstoring a data pattern of a single bit with a value equal to either 0or 1. A memory cell of an MLC flash memory stores two data bits. Asingle memory cell of an MLC flash memory is therefore capable ofstoring data selected from four data patterns with bit values 00, 01,10, and 11. A memory cell of a TLC flash memory stores three data bits.A single memory cell of a TLC flash memory is therefore capable ofstoring data selected from eight data patterns with bit values 000, 001,010, 011, 100, 101, 110, and 111.

A voltage used to write data to a memory cell of a flash memory isreferred to as a programming voltage. Different programming voltagevalues correspond to different data patterns written to a memory cell.For example, a programming voltage for programming memory cells of anSLC flash memory has two different programming voltage values, aprogramming voltage for programming memory cells of an MLC flash memoryhas four different programming voltage values, and a programming voltagefor programming memory cells of a TLC flash memory has eight differentprogramming voltage values. When a controller wants to write a datapattern to a memory cell of a flash memory, the flash memory sets thevoltage level of the memory cell to be equal to the programming voltagevalues corresponding to the data pattern. When the controller requiresthe flash memory to read data from the memory cell, the flash memorymeasures the voltage level of the memory cell, and then compares thevoltage level with the programming voltage values to determine whichdata pattern is stored in the memory cell.

Referring to FIG. 1, a schematic diagram of data programming of a memorycell of a TLC flash memory is shown. A single memory cell of the TLCflash memory stores three data bits including a least significant bit(LSB), a center significant bit (CSB), and an most significant bit(MSB). The flash memory sequentially writes the LSB, the CSB, and theMSB to a memory cell. First, when the LSB is written to the memory cell,the flash memory adjusts the programming voltage of the memory cell tothe level 121 or the level 122 shown in FIG. 1 according to whether thevalue of the LSB is the bit 0 or bit 1. When the CSB is written to thememory cell, the flash memory then adjusts the programming voltage ofthe memory cell to the level 111, the level 112, the level 113, or thelevel 114 shown in FIG. 1 according to whether the value of the CSB isthe bit 0 or bit 1, wherein the levels 111, 112, 113, and 144 indicatethat the stored data content of the memory cell is respectively the bitpattern ‘11’, ‘01’, ‘00’, and ‘10’. When the MSB is finally written tothe memory cell, the flash memory adjusts the programming voltage of thememory cell to the level 101, 102, 103, 104, 105, 106, 107, or 108 shownin FIG. 1 according to whether the value of the MSB is the bit 0 or bit1, wherein the levels 101, 102, 103, 104, 105, 106, 107, and 108indicate that the stored data content of the memory cell is respectivelythe bit pattern ‘111’, ‘011’, ‘001’, ‘101’, ‘100’, ‘000’, ‘010’, and‘110’.

When a gap between the programming voltages corresponding to neighboringdata patterns increases, the flash memory can easily identify theneighboring data patterns from each other. As shown in FIG. 1, the gapsbetween the neighboring programming voltage levels 101 and 102, 102 and103, 103 and 104, 104 and 105, 105 and 106, 106 and 107, and 107 and 108are roughly equal to each other. The data patterns corresponding to theneighboring programming voltages 101 and 102 are respectively ‘111’ and‘011’, and the difference bit between the data patterns corresponding tothe neighboring programming voltages 101 and 102 is therefore an MSB.The data patterns corresponding to the neighboring programming voltages102 and 103 are respectively ‘011’ and ‘001 ’, and the difference bitbetween the data patterns corresponding to the neighboring programmingvoltages 102 and 103 is therefore a CSB. The data patterns correspondingto the neighboring programming voltages 103 and 104 are respectively‘001’ and ‘101’, and the difference bit between the data patternscorresponding to the neighboring programming voltages 103 and 104 istherefore an MSB. Similarly, the difference bit between the datapatterns corresponding to the neighboring programming voltages 104 and105, 105 and 106, 106 and 107, and 107 and 108 are thereforerespectively an LSB, an MSB, a CSB, and an MSB. Thus, the difference bithas a higher probability to be an MSB, a medium probability to be a CSB,and a lower probability to be an LSB. When a plurality of memory cellsof a flash memory are equally programmed according to the programmingvoltages 101, 102, 103, 104, 105, 106, 107, and 108, an MSB thereforehas the highest amount of error rate occurrences, a CSB therefore has amedium amount of error rate occurrences, and an LSB therefore has thelowest amount of error rate occurrences. Because the MSB is moresignificant than the CSB and the LSB, if the MSB has a higher amount oferror rate occurrences than those of the CSB and the LSB according tothe conventional programming voltage shown in FIG. 1, resulting errorswould have a greater impact on data written to a flash memory accordingto the conventional programming voltages. Thus, a data writing method isrequired to lower the error rate of an MSB of data written to a flashmemory, thereby improving the performance of a data storage device.

BRIEF SUMMARY OF THE INVENTION

The invention provides a data writing method. In one embodiment, a datastorage device comprises a flash memory, and the flash memory comprisesa plurality of memory cells. First, a plurality of programming voltagevalues for programming most significant bits (MSB) of a plurality ofstored data patterns of the memory cells of the flash memory areadjusted to obtain a plurality of adjusted programming voltage values. Atarget data is then received from a host. The flash memory is thendirected to write the target data thereto according to the adjustedprogramming voltage values.

The invention provides a data storage device. In one embodiment, thedata storage device is coupled to a host, and comprises a flash memoryand a controller. The flash memory comprises a plurality of memorycells. The controller adjusts a plurality of programming voltage valuesfor programming most significant bits (MSB) of a plurality of storeddata patterns of the memory cells of the flash memory to obtain aplurality of adjusted programming voltage values, receiving a targetdata from the host, and directs the flash memory to write the targetdata thereto according to the adjusted programming voltage values.

The invention provides a data writing method. In one embodiment, a datastorage device comprises a flash memory. First, the flash memory isdirected to read a plurality of programming voltage values for dataprogramming. The programming voltage values are then adjusted to obtaina plurality of adjusted programming voltage values according todifference bits between a plurality of stored data patternscorresponding to the programming voltage values. The adjustedprogramming voltage values are then sent to the flash memory. The flashmemory is then directed to perform data programming according to theadjusted programming voltage values, wherein the data programmedaccording to the adjusted programming voltage values has a lower errorbit rate than that of the data programmed according to the programmingvoltage values.

The invention provides a data storage device. In one embodiment, thedata storage device comprises a flash memory and a controller. The flashmemory comprises a plurality of memory cells. The controller directs theflash memory to read a plurality of programming voltage values for dataprogramming when the data storage device is enabled, adjusts theprogramming voltage values to obtain a plurality of adjusted programmingvoltage values according to difference bits between a plurality ofstored data patterns corresponding to the programming voltage values,sends the adjusted programming voltage values to the flash memory, anddirects the flash memory to perform data programming according to theadjusted programming voltage values, wherein the data programmedaccording to the adjusted programming voltage values has a lower errorbit rate than that of the data programmed according to the programmingvoltage values.

A detailed description is given in the following embodiments withreference to the accompanying drawings.

BRIEF DESCRIPTION OF THE DRAWINGS

The invention can be more fully understood by reading the subsequentdetailed description and examples with references made to theaccompanying drawings, wherein:

FIG. 1 is a schematic diagram of data programming of a memory cell of aTLC flash memory;

FIG. 2 is a block diagram of a data storage device according to theinvention;

FIG. 3 is a flowchart of a method for writing data to the flash memoryaccording to the invention;

FIG. 4 is a flowchart of a method for adjusting programming voltagevalues according to the invention;

FIG. 5 is a schematic diagram of adjusted programming voltage valuesgenerated according to the invention;

FIG. 6 is a schematic diagram of a comparison between originalprogramming voltage values and adjusted programming voltage values;

FIG. 7A is a schematic diagram of statistics of error bits withreference to a page index of a flash memory written according to theoriginal programming voltage values of FIG. 1;

FIG. 7B is a schematic diagram of statistics of error bits withreference to a page index of a flash memory written according to theadjusted programming voltage values of FIG. 5;

FIG. 8 is a flowchart of another embodiment of a method for adjustingprogramming voltage values according to the invention;

FIG. 9A is a schematic diagram of statistics of error bits of dataprogrammed according to the original programming voltage values of FIG.1 in reference to erase cycles; and

FIG. 9B is a schematic diagram of statistics of error bits of dataprogrammed according to the adjusted programming voltage values of FIG.5 in reference to erase cycles.

DETAILED DESCRIPTION OF THE INVENTION

The following description is of the best-contemplated mode of carryingout the invention. This description is made for the purpose ofillustrating the general principles of the invention and should not betaken in a limiting sense. The scope of the invention is best determinedby reference to the appended claims.

Referring to FIG. 2, a block diagram of a data storage device 204according to the invention is shown. The data storage device 204 iscoupled to a host 202. In one embodiment, the data storage device 204comprises a controller 212 and a flash memory 214. The controller 212writes data to the flash memory 214 according to commands sent from thehost 202, and reads data from the flash memory 214 according to commandssent from the host 202. The flash memory 214 comprises a plurality ofblocks 221˜22K for data storage. The flash memory 214 may be a multilevel cell (MLC) flash memory or a triple level cell (TLC) flash memory.The flash memory 214 further comprises a programming voltage register230 for storing a plurality of programming voltage values. When thecontroller 212 sends a write command and data to the flash memory 214,the flash memory 214 writes the data to the flash memory 214 accordingto the programming voltage values stored in the programming voltageregister 230. The controller 212 can therefore adjust the programmingvoltages used to program data by adjusting the programming voltagevalues stored in the programming voltage register 230.

Referring to FIG. 3, a flowchart of a method 300 for writing data to theflash memory 214 according to the invention is shown. First, the datastorage device 204 is enabled. The controller 212 then directs the flashmemory 214 to read a plurality of programming voltage values forprogramming data from a programming voltage register 230 (step 304). Theflash memory 214 then sends the programming voltage values read from theprogramming voltage register 230 to the controller 212 (step 306). Thecontroller 212 then adjusts the programming voltage values to obtain aplurality of adjusted programming voltage values (step 308). In oneembodiment, the controller 212 adjusts the programming voltage valuesaccording to difference bits between stored data patterns correspondingto the programming voltage values. For example, the programming voltagevalues 102, 103, 104, 105, 106, 107, and 108 shown in FIG. 1respectively correspond to the data patterns 011, 001, 101, 100, 000,010, and 110. The controller 212 determines whether a difference bitbetween two data patterns corresponding to neighboring programmingvoltage values is MSB, CSB, or LSB as a reference for adjusting theprogramming voltage values. When the flash memory is an MLC flashmemory, the controller 212 determines whether a difference bit betweentwo data patterns corresponding to neighboring programming voltagevalues is MSB or LSB as a reference for adjusting the programmingvoltage values. The detailed steps for adjusting the programming voltagevalues are illustrated with embodiments shown in FIGS. 4 and 8. Thecontroller 212 then sends the adjusted programming voltage values to theflash memory 214 (step 310). The flash memory 214 then writes theadjusted programming voltage values to the programming voltage register230 (step 312). The flash memory 214 then performs data writingaccording to the adjusted programming voltage values stored in theprogramming voltage register 230 (step 314).

Referring to FIG. 4, a flowchart of a method 400 for adjustingprogramming voltage values according to the invention is shown. First,the controller 212 determines a plurality of neighboring data pairs froma plurality of stored data patterns of memory cells of the flash memory214 (step 402), wherein each of the neighboring data pairs comprises twodata patterns respectively corresponding to programming voltage valuesneighboring to each other. For example, the neighboring data pairs shownin FIG. 1 comprises (A) the data patterns ‘111’ and ‘011’ correspondingto neighboring programming voltage values 101 and 102, (B) the datapatterns ‘011’ and ‘001’ corresponding to neighboring programmingvoltage values 102 and 103, (C) the data patterns ‘001’ and ‘101’corresponding to neighboring programming voltage values 103 and 104, (D)the data patterns ‘101’ and ‘100’ corresponding to neighboringprogramming voltage values 104 and 105, (E) the data patterns ‘100’ and‘000’ corresponding to neighboring programming voltage values 105 and106, (F) the data patterns ‘000’ and ‘010’ corresponding to neighboringprogramming voltage values 106 and 107, and (G) the data patterns ‘010’and ‘110’ corresponding to neighboring programming voltage values 107and 108.

The controller 212 then determines a plurality of difference bitsbetween the data patterns of each of the neighboring data pairs (step404). For example, the difference bit between the data patterns 111 and011 of the neighboring data pair (A) is an MSB, the difference bitbetween the data patterns 011 and 001 of the neighboring data pair (B)is a CSB, the difference bit between the data patterns 001 and 101 ofthe neighboring data pair (C) is an MSB, the difference bit between thedata patterns 101 and 100 of the neighboring data pair (D) is an LSB,the difference bit between the data patterns 100 and 000 of theneighboring data pair (E) is an MSB, the difference bit between the datapatterns 000 and 010 of the neighboring data pair (F) is an CSB, and thedifference bit between the data patterns 010 and 110 of the neighboringdata pair (G) is an MSB. The controller 212 then determines a targetdifference bit with a highest occurrence frequency from the differencebits (step 406). For example, the difference bit MSB has an occurrencefrequency of 4, the difference bit CSB has an occurrence frequency of 2,and the difference bit LSB has an occurrence frequency of 1. Thecontroller 212 therefore selects the MSB as the target difference bit.

The controller 212 then adjusts the programming voltage values toincrease the gaps between the adjusted programming voltage valuescorresponding to the data patterns of the neighboring data pairscorresponding to the target difference bit (step 408). Referring to FIG.5, a schematic diagram of adjusted programming voltage values generatedaccording to the invention is shown. The controller 212 selects the MSBto be the target difference bit, and the neighboring data pairscorresponding to the target difference bit MSB are (A) the data patterns111 and 011, (C) the data patterns 001 and 101, (E) the data patterns100 and 000, and (G) the data patterns 010 and 110. The controller 212therefore adjusts the programming voltage values to increase the gapsbetween (A) the data patterns 111 and 011, (C) the data patterns 001 and101, (E) the data patterns 100 and 000, and (G) the data patterns 010and 110, as shown in FIG. 5. Finally, the controller 212 sends theadjusted programming voltage values to the flash memory 214 (step 410).

According to the method 400, the controller 212 increases the gapsbetween the data patterns of the neighboring data pairs corresponding tothe target difference bit with the highest occurrence frequency. Becauseerrors of a difference bit having a higher occurrence frequency generatea greater impact to a total error bit rate, when the gaps between thedata patterns of the neighboring data pairs corresponding to the MSBwith the highest occurrence frequency are increased, although the gapsbetween the data patterns of the neighboring data pairs corresponding tothe CSB and LSB are reduced, the total error bit rate is still reduced.The performance of the data storage device 204 is therefore improved.Referring to FIG. 6, a schematic diagram of a comparison betweenoriginal programming voltage values and adjusted programming voltagevalues are shown. As shown in FIG. 1, the original programming voltagevalues of neighboring data pairs corresponding to the difference bit MSBare (−1V, 0.7V), (1.5V, 2.3V), (2.9V, 3.7V), and (4.4V, 5.2V), and thegaps between the data patterns of the neighboring data pairs are 1.7V,0.8V, 0.8V, and 0.7V. As shown in FIG. 5, the adjusted programmingvoltage values of neighboring data pairs corresponding to the differencebit MSB are (−1V, 0.7V), (1.2V, 2.3V), (2.7V, 3.7V), and (4.1V, 5.2V),and the gaps between the data patterns of the neighboring data pairs are1.7V, 1.1V, 1.0V, and 1.1V. The gaps between the adjusted programmingvoltage values of neighboring data pairs corresponding to the differencebit MSB is therefore increased in comparison with those between theoriginal programming voltage values.

Referring to FIG. 7A, a schematic diagram of statistics of error bitswith reference to a page index of a flash memory written according tothe original programming voltage values of FIG. 1 is shown. Ordinarily,an MSB, a CSB, and an LSB are respectively stored in a very weak page, aweak page, and a strong page of a TLC flash memory. As shown in FIG. 7A,when the flash memory is read, the numbers of the error bits of pages ofthe flash memory are not equal to each other. Pages with many error bitsare usually very weak pages storing MSBs. The error bit number of a veryweak page storing MSB is usually greater than 30 bits, resulting in anuncorrectable error by an error correction code. Referring to FIG. 7B, aschematic diagram of statistics of error bits with reference to a pageindex of a flash memory written according to the adjusted programmingvoltage values of FIG. 5 is shown. As shown in FIG. 7B, when the flashmemory is read, pages with many error bits may be strong pages storingLSBs, weak pages storing CSBs, or very weak pages storing MSBs. Theerror bit numbers of a very weak page, a weak page, and a strong pageare usually less than 30 bits, resulting in correctable errors by anerror correction code. Thus, the flash memory 214 performing dataprogramming according to the adjusted programming voltage values hashigh data correctness and a high performance in comparison with a flashmemory performing data programming according to the original programmingvoltage values.

Referring to FIG. 8, a flowchart of another embodiment of a method 800for adjusting programming voltage values according to the invention isshown. Except for steps 805 and 806, the steps of the method 800 arealmost the same as those of the method 400 shown in FIG. 4. First, thecontroller 212 determines a plurality of neighboring data pairs from aplurality of stored data patterns of memory cells of the flash memory214 (step 802), wherein each of the neighboring data pairs comprises twodata patterns respectively corresponding to programming voltage valuesneighboring to each other. The controller 212 then determines aplurality of difference bits between the data patterns of each of theneighboring data pairs (step 804). The controller 212 then obtains errorbit rates corresponding to the difference bits (step 805). For example,the difference bits may be MSB, CSB, and LSB, and the error bit ratecorresponding to the MSB may be higher than the error bit ratescorresponding to the CSB and LSB, as shown in FIG. 7A. The controller212 then determines a target difference bit with the highest error bitrate from the difference bits (step 806). Thus, the controller 212determines the target difference bit to be the MSB. The controller 212then adjusts the programming voltage values to increase the gaps betweenthe adjusted programming voltage values corresponding to the datapatterns of the neighboring data pairs corresponding to the targetdifference bit (step 808). Referring to FIG. 5, the controller 212selects the MSB to be the target difference bit, and the controller 212therefore adjusts the programming voltage values to increase the gapsbetween (A) the data patterns 111 and 011, (C) the data patterns 001 and101, (E) the data patterns 100 and 000, and (G) the data patterns 010and 110. Finally, the controller 212 sends the adjusted programmingvoltage values to the flash memory 214 (step 810).

Referring to FIG. 9A, a schematic diagram of statistics of error bits ofdata programmed according to the original programming voltage values ofFIG. 1 in reference to erase cycles. Assume that an error correctioncode has the capability to correct at most 24 error bits in 1KB of data.Because the 1KB data stored in a flash memory with 4000 erase cycles hasabout 24 error bits, the block endurance of the flash memory is about4000 erase cycles. Referring to FIG. 9B, a schematic diagram ofstatistics of error bits of data programmed according to the adjustedprogramming voltage values of FIG. 5 in reference to erase cycles isshown. Assume that an error correction code has the capability tocorrect at most 24 error bits in 1KB of data. Because the 1KB datastored in a flash memory with 8000 erase cycles has about 24 error bits,the block endurance of the flash memory is about 8000 erase cycles.Thus, the flash memory programmed with the adjusted programming voltagevalues according to the invention has longer block endurance than thatprogrammed with the original programming voltages.

While the invention has been described by way of example and in terms ofpreferred embodiment, it is to be understood that the invention is notlimited thereto. To the contrary, it is intended to cover variousmodifications and similar arrangements (as would be apparent to thoseskilled in the art). Therefore, the scope of the appended claims shouldbe accorded the broadest interpretation so as to encompass all suchmodifications and similar arrangements.

What is claimed is:
 1. A data writing method, wherein a data storagedevice comprises a flash memory, and the flash memory comprises aplurality of memory cells, comprising: adjusting a plurality ofprogramming voltage values for programming most significant bits (MSB)of a plurality of stored data patterns of the memory cells of the flashmemory to obtain a plurality of adjusted programming voltage values,wherein adjusting of the programming voltage values comprises:determining a plurality of neighboring data pairs comprising the storeddata patterns corresponding to the programming voltage valuesneighboring to each other; determining a plurality of difference bitsbetween the stored data patterns of the neighboring data pairs;determining a plurality of target neighboring data pairs with differencebits corresponding to the most significant bits from the neighboringdata pairs; and adjusting the programming voltage values to increase thegaps between the adjusted programming voltage values corresponding tothe stored data patterns of the target neighboring data pairs.
 2. Thedata writing method as claimed in claim 1, further comprising: receivinga target data from a host; and directing the flash memory to write thetarget data thereto according to the adjusted programming voltagevalues.
 3. The data writing method as claimed in claim 1, whereinadjusting of the programming voltage values comprises: reading theprogramming voltage values from a register of the flash memory; sendingthe adjusted programming voltage values to the flash memory; and storingthe adjusted programming voltage values in the register.
 4. The datawriting method as claimed in claim 1, wherein the flash memory is atriple level cell (TLC) flash memory, and each of the stored datapatterns comprise a least significant bit (LSB), a center significantbit (CSB), and a most significant bit (MSB).
 5. A data storage device,coupled to a host, comprising: a flash memory, comprising a plurality ofmemory cells; and a controller, is configured to adjust a plurality ofprogramming voltage values for programming most significant bits (MSB)of a plurality of stored data patterns of the memory cells of the flashmemory to obtain a plurality of adjusted programming voltage values,wherein when the controller adjusts the programming voltage values, thecontroller is configured to determine a plurality of neighboring datapairs comprising the stored data patterns corresponding to theprogramming voltage values neighboring to each other, determine aplurality of difference bits between the stored data patterns of theneighboring data pairs, determine a plurality of target neighboring datapairs with the difference bits corresponding to the most significantbits from the neighboring data pairs, and adjust the programming voltagevalues to increase the gaps between the adjusted programming voltagevalues corresponding to the stored data patterns of the targetneighboring data pairs.
 6. The data storage device as claimed in claim5, wherein the controller is further configured to receive a target datafrom the host, and direct the flash memory to write the target datathereto according to the adjusted programming voltage values.
 7. Thedata storage device as claimed in claim 5, wherein the controller readscontroller adjusts the programming voltage values, and after thecontroller adjusts the programming voltage values, the controller sendsthe adjusted programming voltage values to the flash memory, and theflash memory stores the adjusted programming voltage values in theregister.
 8. The data storage device as claimed in claim 5, wherein theflash memory is a triple level cell (TLC) flash memory, and each of thestored data patterns comprise a least significant bit (LSB), a centersignificant bit (CSB), and a most significant bit (MSB).
 9. A datawriting method, wherein a data storage device comprises a flash memory,comprising: when the data storage device is enabled, directing the flashmemory to read a plurality of programming voltage values for dataprogramming; adjusting the programming voltage values to obtain aplurality of adjusted programming voltage values according to differencebits between a plurality of stored data patterns corresponding to theprogramming voltage values; wherein adjusting of the programming voltagevalues comprises: determining a plurality of neighboring data pairs fromthe stored data patterns, wherein the programming voltage valuescorresponding to the stored data patterns of the neighboring data pairsneighbor to each other; determining a plurality of difference bitsbetween the stored data patterns of the neighboring data pairs;selecting a target difference bit with a highest occurrence frequency ora highest error bit rate from the difference bits; and adjusting theprogramming voltage values to increase the gaps between the adjustedprogramming voltage values corresponding to the stored data patternscorresponding to the target difference bit.
 10. The data writing methodas claimed in claim 9, wherein the data programmed according to theadjusted programming voltage values has a lower error bit rate than thatof the data programmed according to the programming voltage values. 11.The data writing method as claimed in claim 9, further comprising:sending the adjusted programming voltage values to the flash memory; anddirecting the flash memory to perform data programming according to theadjusted programming voltage values.
 12. The data writing method asclaimed in claim 9, wherein the target difference bit is the mostsignificant bit, and the adjusted programming voltage values are forprogramming the most significant bit.
 13. The data writing method asclaimed in claim 9, wherein the flash memory is a triple level cell(TLC) flash memory, and each of the stored data patterns comprise aleast significant bit (LSB), a center significant bit (CSB), and a mostsignificant bit (MSB).
 14. The data writing method as claimed in claim9, wherein the flash memory is a multi level cell (MLC) flash memory,and each of the stored data patterns comprise a least significant bit(LSB and a most significant bit (MSB).
 15. A data storage device,comprising: a flash memory, comprising a plurality of memory cells; anda controller, when the data storage device is enabled, is configured todirect the flash memory to read a plurality of programming voltagevalues for data programming, adjusting the programming voltage values toobtain a plurality of adjusted programming voltage values according todifference bits between a plurality of stored data patternscorresponding to the programming voltage values, wherein when thecontroller adjusts the programming voltage values, the controllerdetermines a plurality of neighboring data pairs from the stored datapatterns, determines a plurality of difference bits between the storeddata patterns of the neighboring data pairs, selects a target differencebit with a highest occurrence frequency or a highest error bit rate fromthe difference bits, and adjusts the programming voltage values toincrease the gaps between the adjusted programming voltage valuescorresponding to the stored data patterns corresponding to the targetdifference bit, wherein the programming voltage values corresponding tothe stored data patterns of the neighboring data pairs neighbor to eachother.
 16. The data storage device as claimed in claim 15, wherein thedata programmed according to the adjusted programming voltage values hasa lower error bit rate than that of the data programmed according to theprogramming voltage values.
 17. The data storage device as claimed inclaim 15, wherein the controller is further configured to send theadjusted programming voltage values to the flash memory, and direct theflash memory to perform data programming according to the adjustedprogramming voltage values.
 18. The data storage device as claimed inclaim 15, wherein the target difference bit is the most significant bit,and the adjusted programming voltage values are for programming the mostsignificant bit.
 19. The data storage device as claimed in claim 15,wherein the flash memory is a triple level cell (TLC) flash memory, andeach of the stored data patterns comprise a least significant bit (LSB),a center significant bit (CSB), and a most significant bit (MSB). 20.The data storage device as claimed in claim 15, wherein the flash memoryis a multi level cell (MLC) flash memory, and each of the stored datapatterns comprise a least significant bit (LSB) and a most significantbit (MSB).